// vite.config.ts
import { defineConfig } from "file:///Users/lz/Desktop/@wr/test-build/vite-project/node_modules/.pnpm/vite@5.4.3/node_modules/vite/dist/node/index.js";
import { vitePlugin } from "file:///Users/lz/Desktop/@wr/ww/packages/vite/dist/index.js";
import { visualizer } from "file:///Users/lz/Desktop/@wr/test-build/vite-project/node_modules/.pnpm/rollup-plugin-visualizer@5.12.0_rollup@4.21.2/node_modules/rollup-plugin-visualizer/dist/plugin/index.js";
import cndImport from "file:///Users/lz/Desktop/@wr/test-build/vite-project/node_modules/.pnpm/vite-plugin-cdn-import@1.0.1_rollup@4.21.2_vite@5.4.3/node_modules/vite-plugin-cdn-import/dist/index.js";

// src/routes.ts
var routes_default = [
  // {
  //   path: '/a',
  //   element: '@/a1.tsx',
  //   access:'wew'
  // },
  // {
  //   path: '/app',
  //   element: '@/app.tsx',
  //   access:'222'
  // },
  // {
  //   path: '/h1',
  //   element: '@/h1.tsx',
  //   access:'222'
  // },
  {
    path: "/h2",
    element: "@/h2.tsx",
    access: "222"
  }
];

// vite.config.ts
var vite_config_default = defineConfig({
  plugins: [vitePlugin({
    routes: routes_default
  }), {
    name: "test-ui",
    transform(code, id) {
      if (id.includes("/vite-project/src/h1.tsx")) {
        console.log("\n===>", id);
        console.log("\nimportedIds===>", JSON.stringify(this.getModuleInfo(id)));
        return {
          moduleSideEffects: false
        };
      }
    }
  }, visualizer(), cndImport({
    modules: [{
      name: "react",
      var: "React",
      path: "https://unpkg.com/react@18.3.1/umd/react.production.min.js"
    }, {
      name: "react-dom",
      var: "ReactDOM",
      path: "https://unpkg.com/react-dom@18.3.1/umd/react-dom.production.min.js"
    }]
  })],
  resolve: {
    alias: {
      "@": "/src/",
      qps: "/src/.qps/exports.ts"
    }
  },
  build: {
    assetsDir: "",
    minify: false,
    rollupOptions: {
      external: ["react", "react-dom"],
      output: {
        entryFileNames: `index.js`,
        esModule: false,
        // manualChunks: (id: string, meta) => {
        //   // if (id.includes(normalizePath(path.join(__dirname, './src/h1')))) {
        //   // //  console.log(id)
        //   //   // return 'h1'
        //   //       //  console.log(id,meta.getModuleIds(),meta.getModuleInfo(id)?.importedIds)
        //   // }
        //   // if (id.includes('/Users/lz/Desktop/@wr/test-build/vite-project/src/utils/helper.ts')) {
        //   //   // console.log(meta.getModuleInfo(id)?.importers,meta.getModuleInfo(id))
        //   //   console.log(id,meta.getModuleInfo(id))
        //   //   return 'h1'
        //   // }
        //       //   if(id.includes('/node_modules/antd/es/button/index.js')){
        //       //     console.log(id)
        //       //     return 'antd-button'
        //       //   }
        //       //   if(id.includes('/node_modules/antd/es/form/index.js')){
        //       //     console.log(id)
        //       //     return 'antd-form'
        //       //   }
        //       //   if(id.includes('/node_modules/antd/es/input/index.js')){
        //       //     console.log(id)
        //       //     return 'antd-input'
        //       //   }
        // },
        assetFileNames(chunkInfo) {
          if (chunkInfo.name?.includes("css")) {
            return `index.css`;
          }
          return chunkInfo.name || "";
        }
      }
    },
    cssCodeSplit: false
  }
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAic3JjL3JvdXRlcy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIi9Vc2Vycy9sei9EZXNrdG9wL0B3ci90ZXN0LWJ1aWxkL3ZpdGUtcHJvamVjdFwiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiL1VzZXJzL2x6L0Rlc2t0b3AvQHdyL3Rlc3QtYnVpbGQvdml0ZS1wcm9qZWN0L3ZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9Vc2Vycy9sei9EZXNrdG9wL0B3ci90ZXN0LWJ1aWxkL3ZpdGUtcHJv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